package com.becca.cake.dao.fixing;

import java.util.List;
import java.util.Map;

import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Repository;

import com.becca.cake.model.goods.GoodsFixingModel;

/**
 * 配件管理DAO接口
 * @copyright  尊星(上海)信息科技有限公司
 * @author 
 * @date 2016年6月13日 下午7:44:33
 */
@Repository
public interface FixingDAO {
    /**
     * 查询所有配件
     * @param map
     * @return
     * @throws DataAccessException
     */
    List<GoodsFixingModel> queryFixings(Map<String, Object> map) throws DataAccessException;

    /**
     * 
     * 获取配件数据总条数
     * @param map
     * @return
     * @throws DataAccessException
     */
    Long selectFixingCount(Map<String, Object> map) throws DataAccessException;

    /**
     * 添加配件信息
     * @param goodsModel
     * @throws DataAccessException
     */
    void insertFixing(GoodsFixingModel goodsFixingModel) throws DataAccessException;

    /**
     * 修改配件信息
     * @param goodsModel
     * @throws DataAccessException
     */
    void updateFixing(GoodsFixingModel goodsFixingModel) throws DataAccessException;

    /**
     * 启用/禁用 、可选/不可选配件
     * @param id
     * @throws DataAccessException
     */
    void updEnableOrOptionById(Map<String, Object> map) throws DataAccessException;

    /**
     * 根据商品编号查找商品对象
     * @param goodsId
     * @return
     * @throws DataAccessException
     */
    GoodsFixingModel selectFixingById(Integer fixingId) throws DataAccessException;

    /**
     * 判断配件是否已经启用/禁用
     * @param map
     * @return
     * @throws DataAccessException
     */
    Long IsEnableExist(Map<String, Object> map) throws DataAccessException;

    /**
     * 判断配件是否已经可选/不可选
     * @param map
     * @return
     * @throws DataAccessException
     */
    Long IsOptionalExist(Map<String, Object> map) throws DataAccessException;

    /**
     * 添加时设置配件编码
     * @throws DataAccessException
     */
    void updFixingCode(Map<String, Object> map) throws DataAccessException;

    /**
     * 根据配件类型查询配件信息
     * @param map
     * @return
     * @throws DataAccessException
     */
    List<GoodsFixingModel> selectFixingsByFixingType(Map<String, Object> map)
                                                                             throws DataAccessException;

}
